function setTrBgcolor(obj, types, bgtypes) {
    if (types == 1) {
        obj.style.background = "#999999";
    }
    else {
        if (bgtypes == 1) {
            obj.style.background = "#F6F6F6";
        }
        else {
            obj.style.background = "";
        }
    }
}

// searchStr是用来记录搜索时的条件字符串的，生产格式如下：“&name=abc&id=1&pid=8”;
function tunePage(toPageNo, pageNo, searchStr) {
    try {
        if (searchStr != "null"&&searchStr.length>0) {
            //  alert("add_searchStr_pathname=" + window.location.pathname +"?pageNo="+ toPageNo + searchStr);
            window.location = window.location.pathname + "?pages=" + toPageNo + searchStr;
        }
        else {
            var topage = 1;
            if (typeof(toPageNo) != "number" || toPageNo < 1) topage = 1;
            else topage = toPageNo;
            // olds是得到连接后面的条件，比如 xxx.do?name=abc 那么olds=?name=abc;
            var olds = window.location.search;
            //alert(olds);
            if (typeof(pageNo) == "undefined" || pageNo == "") pageNo = "pages";
            var news = "";
            if (olds.length > 1) {
                olds = olds.substring(1, olds.length);
                var arrays = olds.split("&");
                for (var i = 0; i < arrays.length; i++)
                {
                    if (arrays[i].indexOf(pageNo + "=") < 0 && arrays[i].length > 1) {
                        news += "&" + arrays[i];
                    }
                }
                if (news.length > 1) {
                    news = "?" + news.substring(1, news.length) + "&" + pageNo + "=" + topage;
                }
                else {
                    news = "?" + pageNo + "=" + topage;
                }
            }
            else {
                news = "?" + pageNo + "=" + topage;
            }
//            alert("not--searchStr_pathname=" + window.location.pathname + " not--addsearchst_news=" + news);
            window.location = window.location.pathname + news;
        }
    }
    catch(e) {
        alert("catch...")
        window.location = window.location.pathname + window.location.search;
    }
}

function sAll(thisObj, dObj) {
    try {
        var l = eval(dObj + ".length");
        if (typeof(l) == "undefined") {
            eval(dObj).checked = thisObj.checked;
        }
        else {
            for (var i = 0; i < l; i++) {
                if (!eval(dObj + "[" + i + "]").disabled) eval(dObj + "[" + i + "]").checked = thisObj.checked;
            }
        }
    }
    catch(e) {
    }
}

function sReverse(dObj) {
    try {
        var l = eval(dObj + ".length");
        if (typeof(l) == "undefined") {
            eval(dObj).checked = !eval(dObj).checked;
        }
        else {
            for (var i = 0; i < l; i++) {
                if (!eval(dObj + "[" + i + "]").disabled) eval(dObj + "[" + i + "]").checked = !eval(dObj + "[" + i + "]").checked;
            }
        }
    }
    catch(e) {
    }
}
